<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="go-to-baidu">百度</div>
<div id="go-to-meituan">美团</div>
<div id="go-back">back</div>
<div id="go-forward">go</div>
<script>
    document.getElementById('go-to-baidu').onclick = function () {
        window.location.href = 'https://www.baidu.com'
    }
    document.getElementById('go-to-meituan').onclick = function () {
        window.location.href = 'https://www.meituan.com'
    }
    document.getElementById('go-back').onclick = function () {
        window.history.back()
        // window.history.go(-1)
    }
    document.getElementById('go-forward').onclick = function () {
        window.history.forward()
        // window.history.go(1)
    }

</script>
</body>
</html>
